package com.liu.project.service.impl;

import com.liu.project.dao.FeedbackMapper;
import com.liu.project.pojo.Feedback;
import com.liu.project.pojo.FeedbackType;
import com.liu.project.service.FeedbackService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: project
 * @description: 反馈操作
 * @author: 86187
 * @create: 2022-02-21 16:33
 **/

@Service
public class FeedbackServiceImpl implements FeedbackService {

    @Autowired
    FeedbackMapper feedbackMapper;

    @Override
    public List<Feedback> findAll() {
        return feedbackMapper.findAll();
    }

    @Override
    public Feedback findOneById(int id) {
        return feedbackMapper.findOneById(id);
    }

    @Override
    public Feedback findOneByTitle(String title) {
        return feedbackMapper.findOneByTitle(title);
    }

    @Override
    public List<Feedback> findByKey(String key) {
        return feedbackMapper.findByKey(key);
    }

    @Override
    public List<Feedback> findByType(int fid) {
        return feedbackMapper.findByType(fid);
    }

    @Override
    public List<Feedback> findByTreatment(boolean treatment) {
        return feedbackMapper.findByTreatment(treatment);
    }

    @Override
    public boolean insertOne1(Feedback feedback) {
        int i = feedbackMapper.insertOne1(feedback);
        return i>0;
    }

    @Override
    public boolean insertOne2(FeedbackType feedbackType) {
        int i = feedbackMapper.insertOne2(feedbackType);
        return i>0;
    }

    @Override
    public boolean updateOne(Feedback feedback) {
        int i = feedbackMapper.updateOne(feedback);
        return i>0;
    }

    @Override
    public boolean deleteOne(int id) {
        int i = feedbackMapper.deleteOne(id);
        return i>0;
    }

    @Override
    public String findTypeByFid(int fid) {
        return feedbackMapper.findTypeByFid(fid);
    }

    @Override
    public List<FeedbackType> findAllType() {
        return feedbackMapper.findAllType();
    }
}
